<%@ page import="njust.edu.entity.User" %>
<%@ page import="njust.edu.entity.Trade" %>
<%@ page import="njust.edu.entity.TradeItem" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 陈
  Date: 2021/9/25
  Time: 22:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>订单详细信息</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <meta charset="utf-8">
    <title></title>
    <style>
        a:link {text-decoration:none;}
        a:visited {text-decoration:none;}
        a:hover {text-decoration:none;}
        a:active {text-decoration:none;}
        p{
            font-family:georgia;
            font-weight: 100;
        }
        .header {
            font-size: 94%;
            opacity: 0.8;
            position: absolute;
            top: 0;
            width: 100%;
            height: 80px;
        }
        .header ul {
            list-style-type: none;
            background-color: #333;
            margin: 0;
            padding: 0;
            overflow: hidden;
            width: 100%;
            height: 80px;
        }

        .header li {
            float: left;
            height: 80px;
            width: 200px;
            font-size: 150%;
        }

        .header li a {
            display: block;
            color: white;
            text-align: center;
            padding: 30px;
            text-decoration: none;
            height: 80px;
        }

        .header li a:hover:not(.active) {
            background-color: #111;
        }
        .container{
            position:absolute;
            width:1600px;
            height:1120px;
            top:80px;
            align-self: center;
            background-color: 	#F5FFFA;
            opacity: 0.8;
            border-radius: 45px/150px;
            left: 400px;
        }

        .catalogue{
            position:relative;
            width:1500px;
            height:180px;
            left:50px;
            align-self: center;
            padding-left: 8px;
            /*background-color: wheat;*/
        }
        .back_button{
            display: block;
            position: relative;
            float: left;
            background-color: white;
            margin-right: 200px;
            font-size: 160%;
            text-align: center;
            color: black;
            padding: 20px;
            text-decoration: none;
            height: 80px;
            border-style: solid;
            border-width: 5px;
            border-color: darkgrey;
            border-radius: 20px;
        }
        .back_button:hover:not(.active) {
            background-color: lightgrey;
        }
        .trade_info{
            position: relative;
            float: left;
            width: 500px;
            height: 180px;
            /*background-color: white;*/
            padding-top: 15px;
            font-size: 150%;
            text-align: left;
        }
        .dish_list{
            margin-top: 30px;
            position:relative;
            width:1500px;
            height:720px;
            left:50px;
            align-self: center;
            overflow: auto;
            /*background-color: white;*/
        }
        .dish_item{
            position:relative;
            width:1350px;
            height:80px;
            left:0px;
            margin-left: 20px;
            align-self: center;
            overflow: auto;
            float: left;
            border-top-style: solid;
            border-left-style: none;
            border-bottom-style: none;
            border-right-style: none;
            border-width: 0.5px;
            font-size: 160%;
        }
        .dish_info{
            position: relative;
            float: left;
            height: 70px;
            /*background-color: white;*/
            margin-left: 20px;
            margin-right: 20px;
            padding-top:20px;
            font-size: 120%;
            text-align: center;
        }
        .cart_pagination{
            position:relative;
            width:1500px;
            height:120px;
            left:50px;
            align-self: center;
            overflow: auto;
            background-color: white;
            font-size: 180%;
            padding-top: 10px;
            padding-left: 550px;
        }
        .page-link{
            border-style: none;
            outline: none;
        }
        .cart_summary{
            position:relative;
            width:1450px;
            height:180px;
            left:50px;
            align-self: center;
            overflow: auto;
            background-color: #FFEBCD;
            border-radius: 30px/100px;
        }
        .cart_remark{
            position:relative;
            width:600px;
            height:150px;
            left:30px;
            top:30px;
            overflow: auto;
            float: left;
            /* background-color: white; */
        }
        .cart_price{
            position:relative;
            width:260px;
            height:60px;
            top: 30px;
            left: 200px;
            overflow: auto;
            float: left;
            /* 	background-color: white; */
            font-size: 180%;
        }

    </style>
</head>
<body>
<div class = "backGround" style="position: relative;">
    <img src = "../img/trade.jpg" width="2402px" height="1202px">
<div class="header">
    <ul>
        <li><a href="BookController?method=itemManageUI"><p>管理菜品</p></a></li>
        <li><a href="TradeController?method=toTradeManageUI"><p>查看订单</p></a></li>
        <li><a href="UserController?method=toFinanceUI"><p>查看营业额</p></a></li>
        <li><a href="UserController?method=toSalaryUI" ><p>查看业绩</p></a></li>
        <li style="float: right"><a href="index.jsp" ><p>退出登录</p></a></li>
    </ul>
</div>
<div class = "container">
    <div class = "catalogue">
        <%
            User user = (User) request.getAttribute("user");
        %>
        <a href="TradeController?method=toTradeManageUI" class = "back_button"><p>&lt;&lt;返回</p></a>
        <%
            Trade trade = (Trade)request.getAttribute("trade");
            if(trade!=null){
        %>
        <div class = "trade_info">
            <p>订单号：<%=trade.getId()%></p>
            <p>桌号：<%=trade.getCustomer_table()%></p>
            <p>用户名：<%=trade.getUserId()%></p>
        </div>
        <div class = "trade_info">
            <p>订单状态：<%=trade.getState()==1?"等待接收":"已接收"%></p>
            <p>下单时间：<%=trade.getDate()%></p>
            <p>接单员工ID：<%=trade.getState()==1?"暂无":trade.getStaff_Id()%></p>
        </div>
        <%
            }
        %>
    </div>
    <div class= "dish_list" >
        <%
            List<TradeItem> tradeItemList = (List<TradeItem>) request.getAttribute("tradeItemList");
            if(!tradeItemList.isEmpty()){
                for (TradeItem tradeItem:tradeItemList){
        %>
        <div class = "dish_item" style="border-top-style: none;">
            <div class = "dish_info" id = "dish_id" style="width: 160px;"><p><%=tradeItem.getDishId()%></p></div>
            <div class = "dish_info" id = "dish_name" style="width: 200px;"><p><%=tradeItem.getDishName()%></p></div>
            <div class = "dish_info" id = "dish_price" style="width: 160px;margin-left: 100px;"><p><%=tradeItem.getDishPrice()%>元</p></div>
            <div class = "dish_info" id = "dish_num" style="width: 120px; margin-left: 200px;"><p><%=tradeItem.getQuantity()%>份</p></div>
            <div class = "dish_info" id = "total_price" style="width: 160px;"><p><%=tradeItem.getDishPrice()*tradeItem.getQuantity()%>元</p></div>
        </div>
        <%
                }
            }
        %>
    </div>
    <div class= "cart_summary" >
        <div class="cart_remark">
            <p style="float: left; font-size: 200%; font-weight: 100;">备注：</p>


        </div>
        <div class="cart_price"><p>共 <%=trade.getDish_num()%> 份</p></div>
        <div class="cart_price"><p>总计 <%=trade.getPrice()%> 元</p></div>

    </div>
</div>
</div>
</body>


</html>


